/**
* connect to mysql
*/

package ucs

import (
	"github.com/cz-it/log4golang/log"
	"database/sql"
	_ "github.com/go-sql-driver/mysql"
)

func CertifyUser(userName string){
	db, err := sql.Open("mysql", "ucs:ucs@2014@tcp(127.0.0.1:3306)/db_ucs")
	if err != nil {
		panic(err)
	}
	defer db.Close()
	
	stmt, err := db.Prepare("select f_user_passwd from t_userinfo where f_user_name=?")

	if err != nil {
		panic(err)
	}
	defer stmt.Close()
	
	var pw string
	row := stmt.QueryRow("TestUser")
	row.Scan(&pw)
	log.Debug("Get passwd is %s",pw)

	log.Debug("open db Success")	
}




















